{% extends "_layout.html" %}
{% import "component/forms.njk" as forms %}

{# 样式代码 #}
{% block style %}
<link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
{% endblock %}

{# bodyd代码#}
{% block body %}
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>商户审核</h5>

                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t from" id="form" action="/merchant/audit" method="post" data-href="/merchant">
                    	{{ forms.hidden('id', data.id) }}
                        {{ forms.readonly('姓名', data.name) }}
                        {{ forms.readonly('状态', data.status) }}
                        {{ forms.readonly('店铺名称', data.storeName) }}
                        {{ forms.readonly('所属行业', data.type) }}
                        <label class="col-sm-2 control-label">身份证正面：</label>
                        <img class="img-responsive" src="">
                        <label class="col-sm-2 control-label">身份证正面：</label>
                        <img class="img-responsive" src="">
                        <label class="col-sm-2 control-label">营业执照：</label>
                        <img class="img-responsive" src="">
                        <label class="col-sm-2 control-label">店铺照片：</label>
                        <img class="img-responsive" src="">

                        {{ forms.radios('审核意见', 'authCode', [{text: '通过', value: 1}, {text: '拒绝', value: 0}]) }}
                        {{ forms.text('审核结果', 'authResult', data.authResult, '如果审核未通过，请输入拒绝原因') }}
                        {{ forms.submit() }}

                    </form>
                </div>
            </div>
        </div>

    </div>
{% endblock %}

{#js代码#}
{% block js %}
<script>
    $(function () {
        var e = "";
        $("#form").validate({
            rules: {
                linkName: "required",
                username: {
                    required: true
                },
                mobile: {
                    required: true
                },
                userType: "required",
                sex: "required",
            },
            messages: {
                linkName: {
                    required: e + "请输入姓名"
                },
                username: {
                    required: e + "请输入用户名",
                    remote: '用户已经存在'
                },
                mobile: {
                    required: e + "请输入手机号"
                },
                userType: {
                    required: e + "请输入类型 1.管理员 2.员工 "
                },
                sex: {
                    required: e + "请输入性别"
                },
            },
            submitHandler: function() {
              asyncSubmitForm($("#form"));
            }
        });

    });
</script>

{% endblock %}